package org.cid54.bukkit;

import org.bukkit.event.Event.Priority;
import org.bukkit.event.Event.Type;
import org.bukkit.plugin.PluginDescriptionFile;
import org.bukkit.plugin.PluginManager;
import org.bukkit.plugin.java.JavaPlugin;

/**
 *
 * @author Cid54
 */
public class UtilPlugin extends JavaPlugin {

    public void onDisable() {
        System.out.println("Goodbye");
    }

    public void onEnable() {

        PluginManager pm = getServer().getPluginManager();

        Cid54PlayerListener list = new Cid54PlayerListener();

        pm.registerEvent(Type.PLAYER_CHAT, list, Priority.Normal, this);
        pm.registerEvent(Type.PLAYER_INTERACT, list, Priority.Normal, this);

        Cid54BlockListener blockListener = new Cid54BlockListener();

        pm.registerEvent(Type.BLOCK_DISPENSE, blockListener, Priority.Normal, this);

        pm.registerEvent(Type.ENTITY_DAMAGE, new Cid54AquamanListener(), Priority.High, this);

        PluginDescriptionFile pdfFile = this.getDescription();
        System.out.println(pdfFile.getName() + " version " + pdfFile.getVersion() + " is enabled!");

    }
}
